import java.util.Scanner;

public class Demo04071 {
    //定义三个无参数无返回值方法，分别实现计算三角形、正方形、长方形面积。
    public static void main(String[] args) {
        getSJXarea();
        getZFXarea();
        getCFXarea();
    }

    public static void getSJXarea() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入三角形的底：");
        double bottom = scanner.nextDouble();
        System.out.println("请输入三角形的高：");
        double high = scanner.nextDouble();
        System.out.println("三角形的面积为：" + (bottom * high * 0.5));
    }

    public static void getZFXarea() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入正方形的边长：");
        double bottom = scanner.nextDouble();
        System.out.println("正方形的面积：" + (Math.pow(bottom, 2)));
    }

    public static void getCFXarea(){
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入长方形的长=： ");
        double length =scanner.nextDouble();
        System.out.println("请输入长方形的宽=： ");
        double width =scanner.nextDouble();
        System.out.println("长方形的面积为："+(length*width));
    }
}
